import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {
  JstSaleOutWarehouseOrder1VO,
  JstSaleOutWarehouseOrder1Form,
  JstSaleOutWarehouseOrder1Query
} from '@/api/jdAndJstSceneClassification/consignmentSale/jstSaleOutWarehouseOrder1/types';

/**
 * 查询聚水潭-销售出库单列表
 * @param query
 * @returns {*}
 */

export const listJstSaleOutWarehouseOrder1 = (query?: JstSaleOutWarehouseOrder1Query): AxiosPromise<JstSaleOutWarehouseOrder1VO[]> => {
  return request({
    url: '/dataCheck/jst/saleOutWarehouseOrder/list',
    method: 'get',
    params: query
  });
};

/**
 * 01、定义后端接口
 * 业务查询条件：根据shop_name店铺名称为国内货代仓店铺（分销指定）、京东-TYMO京东自营店、天猫-TYMO天猫超市、天猫-TYMO天猫进口超市查询
 * 查询聚水潭-销售出库单列表（金蝶缺少的数据）
 * @param query
 * @returns {*}
 */

export const listJstSaleOutWarehouseOrder1ByShopName = (query?: JstSaleOutWarehouseOrder1Query): AxiosPromise<JstSaleOutWarehouseOrder1VO[]> => {
  return request({
    url: '/dataCheck/jst/saleOutWarehouseOrder/list-by-shop-name-by-jd-deficiency2',
    method: 'get',
    params: query
  });
};

/**
 * 查询聚水潭-销售出库单详细
 * @param id
 */
export const getJstSaleOutWarehouseOrder1 = (id: string | number): AxiosPromise<JstSaleOutWarehouseOrder1VO> => {
  return request({
    url: '/dataCheck/jst/saleOutWarehouseOrder/' + id,
    method: 'get'
  });
};

/**
 * 新增聚水潭-销售出库单
 * @param data
 */
export const addJstSaleOutWarehouseOrder1 = (data: JstSaleOutWarehouseOrder1Form) => {
  return request({
    url: '/dataCheck/jst/saleOutWarehouseOrder',
    method: 'post',
    data: data
  });
};

/**
 * 修改聚水潭-销售出库单
 * @param data
 */
export const updateJstSaleOutWarehouseOrder1 = (data: JstSaleOutWarehouseOrder1Form) => {
  return request({
    url: '/dataCheck/jst/saleOutWarehouseOrder',
    method: 'put',
    data: data
  });
};

/**
 * 删除聚水潭-销售出库单
 * @param id
 */
export const delJstSaleOutWarehouseOrder1 = (id: string | number | Array<string | number>) => {
  return request({
    url: '/dataCheck/jst/saleOutWarehouseOrder/' + id,
    method: 'delete'
  });
};
